<?php
// 搜索接口
include_once 'conn.php';
$goods = [];
$search = $_POST['search'];
$goods_search = '%'.$search.'%';
$sql = $db->query("SELECT * FROM goods WHERE goods_title LIKE '$goods_search'");
while ($row = $sql -> fetch_assoc()) {
    array_push($goods,$row);
}
echo json_encode($goods);
$db -> close();
?>